package com.yy.xshell.process.commandhandler;

import com.yy.xshell.process.Handler;

import java.util.regex.Pattern;

/**
 * @author wxy
 * @version 1.0
 * @date 2024/8/20 15:35
 */
public class SpecialSymbolHandler extends Handler<String> {

    private static final String pattern_t = "\\\\t";

    private static Pattern pattern = Pattern.compile(pattern_t);

    public String handler(String command) {
        return command.replaceAll(pattern_t, "\t");
    }

    public boolean accept(String command) {
        return pattern.matcher(command).find();
    }
}
